package KMeans;

/*
 * dataset for color combinations
 */
import java.util.*;

public class DataSet {

	LinkedList<CB> cbs = new LinkedList<CB>();

	void show_label() {
		for (int i = 0; i < this.cbs.size(); i++) {
			this.cbs.get(i).show_label();
		}
	}

	void show_correctness() {

	}

	DataSet() {
		/*
		 * randomly generate color combinations, label them with 0
		 */
		this.random_add_cb(30);

		/*
		 * good color combinations: label = 1
		 */
		CB cb1 = new CB();
		cb1.addRegion(225, 238, 210);
		cb1.addRegion(219, 208, 167);
		cb1.addRegion(230, 155, 3);
		cb1.addRegion(209, 75, 78);
		cb1.addRegion(209, 75, 78);
		cbs.add(cb1);

		CB cb2 = new CB();
		cb2.addRegion(87, 105, 60);
		cb2.addRegion(82, 75, 46);
		cb2.addRegion(171, 92, 37);
		cb2.addRegion(255, 255, 255);
		cb2.addRegion(100, 107, 48);
		cbs.add(cb2);

		CB cb3 = new CB();
		cb3.addRegion(255, 245, 247);
		cb3.addRegion(178, 200, 187);
		cb3.addRegion(69, 137, 148);
		cb3.addRegion(117, 121, 71);
		cb3.addRegion(117, 121, 71);
		cbs.add(cb3);

		CB cb4 = new CB();
		cb4.addRegion(130, 57, 53);
		cb4.addRegion(137, 190, 178);
		cb4.addRegion(201, 186, 131);
		cb4.addRegion(222, 211, 140);
		cb4.addRegion(222, 156, 83);
		cbs.add(cb4);

		CB cb5 = new CB();
		cb5.addRegion(180, 141, 1);
		cb5.addRegion(1, 165, 175);
		cb5.addRegion(0, 0, 0);
		cb5.addRegion(255, 255, 255);
		cb5.addRegion(53, 44, 10);
		cbs.add(cb5);

		CB cb6 = new CB();
		cb6.addRegion(17, 63, 61);
		cb6.addRegion(60, 79, 57);
		cb6.addRegion(95, 92, 51);
		cb6.addRegion(179, 214, 110);
		cb6.addRegion(214, 147, 29);
		cbs.add(cb6);

		CB cb7 = new CB();
		cb7.addRegion(199, 237, 253);
		cb7.addRegion(175, 215, 237);
		cb7.addRegion(92, 167, 186);
		cb7.addRegion(255, 66, 93);
		cb7.addRegion(147, 224, 255);
		cbs.add(cb7);

		CB cb8 = new CB();
		cb8.addRegion(254, 67, 101);
		cb8.addRegion(252, 157, 154);
		cb8.addRegion(249, 205, 173);
		cb8.addRegion(200, 200, 169);
		cb8.addRegion(131, 175, 155);
		cbs.add(cb8);

		CB cb9 = new CB();
		cb9.addRegion(219, 69, 32);
		cb9.addRegion(126, 33, 18);
		cb9.addRegion(196, 226, 216);
		cb9.addRegion(255, 255, 255);
		cb9.addRegion(0, 0, 0);
		cbs.add(cb9);

		CB cb10 = new CB();
		cb10.addRegion(207, 191, 140);
		cb10.addRegion(35, 31, 32);
		cb10.addRegion(226, 211, 172);
		cb10.addRegion(253, 218, 4);
		cb10.addRegion(0, 0, 0);
		cbs.add(cb10);

		CB cb12 = new CB();
		cb12.addRegion(90, 13, 67);
		cb12.addRegion(175, 18, 88);
		cb12.addRegion(244, 13, 100);
		cb12.addRegion(244, 222, 41);
		cb12.addRegion(179, 197, 135);
		cbs.add(cb12);

		CB cb13 = new CB();
		cb13.addRegion(38, 188, 213);
		cb13.addRegion(214, 200, 75);
		cb13.addRegion(167, 220, 224);
		cb13.addRegion(225, 233, 220);
		cb13.addRegion(28, 120, 135);
		cbs.add(cb13);

		CB cb14 = new CB();
		cb14.addRegion(182, 194, 154);
		cb14.addRegion(138, 151, 123);
		cb14.addRegion(244, 208, 0);
		cb14.addRegion(29, 131, 8);
		cb14.addRegion(220, 87, 18);
		cbs.add(cb14);

		CB cb15 = new CB();
		cb15.addRegion(210, 188, 167);
		cb15.addRegion(32, 36, 46);
		cb15.addRegion(201, 138, 131);
		cb15.addRegion(189, 172, 156);
		cb15.addRegion(220, 162, 151);
		cbs.add(cb15);

		CB cb16 = new CB();
		cb16.addRegion(203, 203, 203);
		cb16.addRegion(255, 255, 255);
		cb16.addRegion(151, 151, 151);
		cb16.addRegion(36, 169, 225);
		cb16.addRegion(91, 74, 66);
		cbs.add(cb16);

		CB cb17 = new CB();
		cb17.addRegion(151, 173, 172);
		cb17.addRegion(173, 137, 118);
		cb17.addRegion(255, 150, 128);
		cb17.addRegion(0, 34, 40);
		cb17.addRegion(255, 94, 72);
		cbs.add(cb17);

		CB cb18 = new CB();
		cb18.addRegion(29, 191, 151);
		cb18.addRegion(69, 39, 39);
		cb18.addRegion(35, 235, 185);
		cb18.addRegion(110, 112, 73);
		cb18.addRegion(117, 27, 19);
		cbs.add(cb18);

		CB cb19 = new CB();
		cb19.addRegion(232, 221, 203);
		cb19.addRegion(205, 179, 128);
		cb19.addRegion(3, 101, 100);
		cb19.addRegion(3, 54, 73);
		cb19.addRegion(3, 22, 52);
		cbs.add(cb19);

		CB cb20 = new CB();
		cb20.addRegion(89, 69, 61);
		cb20.addRegion(13, 12, 12);
		cb20.addRegion(107, 90, 82);
		cb20.addRegion(166, 137, 124);
		cb20.addRegion(219, 207, 202);
		cbs.add(cb20);

		CB cb21 = new CB();
		cb21.addRegion(248, 232, 137);
		cb21.addRegion(84, 115, 135);
		cb21.addRegion(205, 201, 125);
		cb21.addRegion(255, 255, 255);
		cb21.addRegion(236, 230, 170);
		cbs.add(cb21);

		CB cb22 = new CB();
		cb22.addRegion(25, 24, 22);
		cb22.addRegion(88, 94, 92);
		cb22.addRegion(206, 60, 91);
		cb22.addRegion(77, 69, 79);
		cb22.addRegion(186, 40, 53);
		cbs.add(cb22);

		CB cb23 = new CB();
		cb23.addRegion(247, 68, 97);
		cb23.addRegion(87, 96, 105);
		cb23.addRegion(173, 195, 192);
		cb23.addRegion(243, 244, 246);
		cb23.addRegion(185, 227, 217);
		cbs.add(cb23);

		CB cb24 = new CB();
		cb24.addRegion(227, 160, 93);
		cb24.addRegion(178, 190, 126);
		cb24.addRegion(114, 111, 128);
		cb24.addRegion(56, 13, 49);
		cb24.addRegion(89, 61, 67);
		cbs.add(cb24);

		CB cb25 = new CB();
		cb25.addRegion(255, 255, 255);
		cb25.addRegion(255, 255, 255);
		cb25.addRegion(101, 147, 74);
		cb25.addRegion(64, 116, 52);
		cb25.addRegion(3, 35, 14);
		cbs.add(cb25);

		CB cb26 = new CB();
		cb26.addRegion(205, 164, 158);
		cb26.addRegion(197, 31, 31);
		cb26.addRegion(255, 255, 255);
		cb26.addRegion(156, 38, 50);
		cb26.addRegion(71, 31, 31);
		cbs.add(cb26);

		CB cb27 = new CB();
		cb27.addRegion(250, 218, 161);
		cb27.addRegion(3, 38, 58);
		cb27.addRegion(179, 168, 150);
		cb27.addRegion(222, 125, 44);
		cb27.addRegion(20, 68, 106);
		cbs.add(cb27);

		CB cb28 = new CB();
		cb28.addRegion(226, 17, 0);
		cb28.addRegion(204, 202, 169);
		cb28.addRegion(158, 157, 131);
		cb28.addRegion(213, 23, 0);
		cb28.addRegion(54, 66, 74);
		cbs.add(cb28);

		CB cb29 = new CB();
		cb29.addRegion(78, 29, 76);
		cb29.addRegion(119, 52, 96);
		cb29.addRegion(227, 179, 37);
		cb29.addRegion(255, 255, 255);
		cb29.addRegion(20, 0, 28);
		cbs.add(cb29);

		CB cb30 = new CB();
		cb30.addRegion(23, 44, 60);
		cb30.addRegion(39, 72, 98);
		cb30.addRegion(153, 80, 84);
		cb30.addRegion(217, 104, 49);
		cb30.addRegion(230, 179, 61);
		cbs.add(cb30);

		CB cb31 = new CB();
		cb31.addRegion(174, 221, 129);
		cb31.addRegion(107, 194, 53);
		cb31.addRegion(6, 128, 67);
		cb31.addRegion(0, 0, 0);
		cb31.addRegion(38, 157, 128);
		cbs.add(cb31);

		CB cb32 = new CB();
		cb32.addRegion(23, 50, 7);
		cb32.addRegion(153, 77, 82);
		cb32.addRegion(217, 116, 43);
		cb32.addRegion(230, 180, 80);
		cb32.addRegion(227, 230, 195);
		cbs.add(cb32);
		
		/*
		 * update neighbor distance
		 */
		
		this.update_neighbor_distance();

	}

	/*
	 * randomly generate some add some(num) color combinations and add them into
	 * the dataset
	 */
	void random_add_cb(int num) {
		for (int i = 0; i < num; i++) {
			CB temp = new CB();
			for (int j = 0; j < CB.DEM; j++) {
				temp.randomAddRegion();

			}
			temp.setLabel(1);// suppose the randomly generated cb is not good
			this.cbs.add(temp);
		}
	}

	void update_neighbor_distance() {
		for (int i = 0; i < this.cbs.size(); i++) {
			this.cbs.get(i).distance_neighbor();
		}
	}
}
